<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<title>JSF2 - Download de Arquivos</title>
</h:head>
<h:body>
	<h:form>
		<h2>Click link para fazer o download do arquivo</h2>
	


		<h:commandLink id="getDownload" value="Download Files"
			action="#{fileDownloadBean.downLoad}">
		</h:commandLink>
	</h:form>
	
	<br></br>
	
	
	<!-- inputFile tag to upload file -->
        Upload Arquivos 
        <h:inputFile id="file" 
                     label="file"
                     value="#{fileDownloadBean.part}" 
                     required="true" 
                     requiredMessage="File not selected !!">
            <!-- FileUploadValidator for file validation -->
            <f:validator validatorId="FileUploadValidator" />
        </h:inputFile>
        <h:message style="color: red" for="file" /><br />
 
	
	  <h:commandButton id="submit" 
                         action="#{fileDownloadBean.uploadFile}"
                         value="upload de  Arquivo" /><br />
 
        <!-- status message of file upload; rendered if message is set -->
        <h:outputText value="#{fileDownloadBean.statusMessage}"
                      rendered="#{not empty fileDownloadBean.statusMessage}" />


</h:body>
</html>
